package tech.eyao.hs60x.dao;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import tech.eyao.hs60x.mapper.SafetyZoneDOMapper;
import tech.eyao.hs60x.model.domain.SafetyZoneDO;

@Repository
public class ZoneDao {
	
	@Autowired
	private SafetyZoneDOMapper safetyZoneDOMapper;
	
	public boolean deleteByPrimaryKey(Long id) {
		return safetyZoneDOMapper.deleteByPrimaryKey(id) > 0;
	}

	public boolean insert(SafetyZoneDO record) {
		record.setGmtCreated(new Date());
		record.setGmtModified(new Date());
    	return safetyZoneDOMapper.insert(record) > 0;
    }

	public SafetyZoneDO selectByPrimaryKey(Long id) {
    	return safetyZoneDOMapper.selectByPrimaryKey(id);
    }

	public boolean updateByPrimaryKey(SafetyZoneDO record) {
    	return safetyZoneDOMapper.updateByPrimaryKey(record) > 0;
    }

	public List<SafetyZoneDO> list(long watchId) {
		return safetyZoneDOMapper.list(watchId);
	}
}
